export default {
  deviceLogType: [
    { value: '0', label: '门禁机' },
    { value: '1', label: '室内机' }
  ],
  assetsSourceOptions: [
    { value: '0', label: '购入' },
    { value: '1', label: '自建' },
    { value: '2', label: '租赁' },
    { value: '3', label: '其他' }
  ],
  repairTaskState: [
    { label: '未执行', value: 0 },
    { label: '执行中', value: 1 },
    { label: '已完成', value: 2 }
  ],
  deviceTypeList: [
    { label: '单元机', value: 1 },
    { label: '围墙机', value: 2 }
    // {label: '楼层机', value: 3},
    // {label: '室内机', value: 4}
  ],
  equipmentTypeList: [
    { label: '门禁机', value: 0 },
    { label: '摄像头', value: 1 }
  ],
  deviceStatusList: [
    { label: '离线', value: -1 },
    { label: '在线', value: 1 }
  ],
  monitoringStates: [
    { label: '未使用', value: 0 },
    { label: '离线', value: 2 },
    { label: '在线', value: 1 }
  ],
  installPositionList: [
    { label: '地下室', value: 1 },
    { label: '楼面', value: 2 }
  ],
  workOrderStates: [
    { value: '0', label: '未接单' },
    { value: '1', label: '已接单' },
    { value: '2', label: '已完成' }
  ],
  inspectionState: [
    { value: '1', label: '开启' },
    { value: '0', label: '暂停' }
  ],
  workOrderState: [
    { value: '0', label: '未处理' },
    { value: '1', label: '已处理' },
    { value: '2', label: '处理中' }
  ],
  deviceState: [
    { value: '0', label: '正常' },
    { value: '1', label: '停用' },
    { value: '2', label: '维修' },
    { value: '3', label: '损坏' },
    { value: '4', label: '报废' }
  ],
  formRules: {
    guid: [{ required: true, message: '请输入门禁机GUID', trigger: 'blur' }],
    deviceName: [{ required: true, message: '请输入门禁机名称', trigger: 'blur' }],
    estate: [{ required: true, message: '请选择小区', trigger: 'blur' }],
    estateId: [{ required: true, message: '请选择小区', trigger: 'blur' }],
    streetId: [{ required: true, message: '请选择街道', trigger: 'blur' }],
    building: [{ required: true, message: '请选择楼栋', trigger: 'blur' }],
    unit: [{ required: true, message: '请选择单元', trigger: 'blur' }],
    wifi: [{ required: true, message: '请输入wifi名', trigger: 'blur' }],
    content: [{ required: true, message: '请输入发布内容', trigger: 'blur' }],
    msgType: [{ required: true, message: '请选择发布类型', trigger: 'blur' }],
    title: [{ required: true, message: '请输入标题', trigger: 'blur' }],
    alleyCode: [{
      required: true,
      message: '请输入2或3位数字街巷编号',
      trigger: 'blur',
      validator: (rule, value, callback) => {
        if (value === '') {
          callback(new Error('请输入2或3位数字街巷编号'))
        } else {
          const reg = /^\d{2,3}$/
          if (!reg.test(value)) {
            callback(new Error('请输入2或3位数字街巷编号'))
          } else {
            callback()
          }
        }
      }
    }],
    alleyName: [{ required: true, message: '请选择街巷名称', trigger: 'blur' }],
    buildingId: [{ required: true, message: '请输入楼栋号码', trigger: 'blur' }],
    buildingNumber: [{
      required: true,
      message: '请输入2或3位数字楼栋号',
      trigger: 'blur',
      validator: (rule, value, callback) => {
        if (value === '') {
          callback(new Error('请输入2或3位数字楼栋号'))
        } else {
          const reg = /^\d{2,3}$/
          if (!reg.test(value)) {
            callback(new Error('请输入2或3位数字楼栋号'))
          } else {
            callback()
          }
        }
      }
    }],
    roomNumber: [{ required: true, message: '请输入房号', trigger: 'blur' },
      { min: 4, max: 4, message: '请输入四位数房号', trigger: 'blur' }],
    identityNumber: [{ required: true, message: '请输入身份证号', trigger: 'blur' }],
    name: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
    floorStart: [{ required: true, message: '请输入起始楼层', trigger: 'blur' }],
    floorEnd: [{ required: true, message: '请输入截止楼层', trigger: 'blur' }],
    roomStart: [{ required: true, message: '请输入起始房号', trigger: 'blur' }],
    roomEnd: [{ required: true, message: '请输入截止房号', trigger: 'blur' }],
    importFileList: [{ required: true, message: '请选择导入文件', trigger: 'blur' }],
    landlordType: [{ required: true, message: '请选择房东类型', trigger: 'blur' }],
    estateName: [{ required: true, message: '请输入小区名称', trigger: 'blur' }],
    estateType: [{ required: true, message: '请选择小区类型', trigger: 'blur' }],
    estateArea: [{ required: true, message: '请选择小区所在地区', trigger: 'blur' }],
    estateDetail: [{ required: true, message: '请输入详细地址', trigger: 'blur' }],
    estatePosition: [{ required: true, message: '请输入小区经纬度', trigger: 'blur' }],
    policeAreaCode: [{ required: true, message: '请输入警务区代码', trigger: 'blur' }],
    buildingCount: [{ required: true, message: '请输入小区楼栋数', trigger: 'blur' }],
    houseHoldCount: [{ required: true, message: '请输入小区住户数', trigger: 'blur' }],
    manager: [{ required: true, message: '请输入管理处负责人', trigger: 'blur' }],
    managePhone: [{ required: true, message: '请输入管理处电话', trigger: 'blur' }],
    account: [{ required: true, message: '请输入账号', trigger: 'blur' }],
    username: [{ required: true, message: '请输入账号', trigger: 'blur' }],
    password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
    captcha: [{ required: true, message: '请输入验证码', trigger: 'blur' }],
    dutyAreaName: [{ required: true, message: '请输入责任区域名称', trigger: 'blur' }],
    areaDetail: [{ required: true, message: '请输入详细地址', trigger: 'blur' }],
    buildingCode: [{ required: true, message: '请输入楼栋编号', trigger: 'blur' }],
    buildingName: [{ required: true, message: '请输入楼栋名称', trigger: 'blur' }],
    alley: [{ required: true, message: '选择街巷', trigger: 'blur' }],
    customerType: [{ required: true, message: '选择租客类型', trigger: 'blur' }],
    careType: [{ required: true, message: '请选择关爱人员类型', trigger: 'blur' }],
    isForeign: [{ required: true, message: '请选择是否外籍', trigger: 'blur' }],
    importMsgType: [{ required: true, message: '请选择信息录入方式', trigger: 'blur' }],
    nation: [{ required: true, message: '请选择民族', trigger: 'blur' }],
    sex: [{ required: true, message: '请选择性别', trigger: 'blur' }],
    birthday: [{ required: true, message: '请选择出生日期', trigger: 'blur' }],
    houseHoldTypeOther: [{ required: true, message: '请输入租客类型', trigger: 'blur' }],
    censusRegisterAddress: [{ required: true, message: '请输入户籍地址', trigger: 'blur' }],
    issuingAuthority: [{ required: false, message: '', trigger: 'blur' }],
    identityCode: [{
      required: true,
      validator: (rule, value, callback) => {
        if (value === '') {
          callback(new Error('证件号码不能为空'))
        } else {
          const reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/
          if (!reg.test(value)) {
            callback(new Error('请输入正确的证件号码'))
          } else {
            callback()
          }
        }
      },
      trigger: 'blur'
    }],
    appAuth: [{ required: true, message: '请选择授权开门', trigger: 'blur' }],
    mobile: [{ required: true, message: '请输入手机号码', trigger: 'blur' }],
    expireDate: [{ required: true, message: '请选择有效期限', trigger: 'blur' }],
    roomName: [{ required: true, message: '请输入房间别名', trigger: 'blur' }],
    cardNumber: [{
      required: true,
      trigger: 'blur',
      validator: (rule, value, callback) => {
        if (value === '') {
          callback(new Error('请输入卡号'))
        } else {
          const reg = /^[a-fA-F0-9]+$/
          if (!reg.test(value)) {
            callback(new Error('无效卡号,请重新输入'))
          } else {
            callback()
          }
        }
      }
    }],
    cardNumberNew: [{ required: true, message: '请输入卡号', trigger: 'blur' }],
    deviceUuid: [{ required: true, message: '请输入门禁机MAC地址', trigger: 'blur' }],
    url: [{ required: true, message: '请上传图片', trigger: 'blur' }]
  }

}
